/*
 * UserDao.cpp
 *
 *  Created on: 2018年3月30日
 *      Author: yaoqiaobing
 */

#include "dao/UserDao.hpp"
#include "stdlib/acl_define_unix.h"
#include "stdlib/log.hpp"

UserDao::UserDao(const acl::mysql_conf& mysqlConf, const char* xmlPath) : BaseDao(mysqlConf, xmlPath) {
	// 打开连接、解析xml文件
	acl_assert(daoInit() == 0);
}

UserDao::UserDao(acl::db_mysql* dbHandleMysql, const char* xmlPath) : BaseDao(dbHandleMysql, xmlPath) {
	// 打开连接、解析xml文件
	acl_assert(daoInit() == 0);
}

int UserDao::insertUserData(acl::query& query) {
	int affected_rows;
	execSql(__FUNCTION__, query, affected_rows);
	return affected_rows;
}

int UserDao::deleteUserData(acl::query& query) {
	int affected_rows;
	execSql(__FUNCTION__, query, affected_rows);
	return affected_rows;
}

int UserDao::updateUserData(acl::query& query) {
	int affected_rows;
	execSql(__FUNCTION__, query, affected_rows);
	return affected_rows;
}

const acl::db_rows* UserDao::selectUserData(acl::query& query) {
	int affected_rows;
	return execSql(__FUNCTION__, query, affected_rows);
}


